const router = require('koa-router')();
const collect = require('../modules/collect');

//获取数据
router.get('/userlike',async (ctx,next) => {
    ctx.body = await collect.selectCollect();  
})
//增加数据
router.post('/userlike',async (ctx,next) => {
    ctx.body = await collect.addCollect(ctx.request.body)
})
//删除数据
router.delete('/userlike/:like_id',async (ctx,next) => {
    ctx.body = await collect.deleteCollect(ctx.params);
})
//修改数据
router.put('/userlike',async (ctx,next) => {
    ctx.body = await collect.putCollect(ctx.request.body)
})

module.exports = router;